package nl.hanze.designpatterns.domain;

import java.util.ArrayList;
import java.util.List;

public class Question extends ThesaurusItem{

	private List<ThesaurusItem> items;
	private String question;
	
	public Question(String answer, String question, String description){
		super(answer, description);
		this.items = new ArrayList<ThesaurusItem>();
		this.setQuestion(question);
	}
	
	public Question(String question, String description){
		this(null, question, description);
	}
	
	public void addItem(ThesaurusItem item){
		this.items.add(item);
	}
	
	public String getQuestion() {
		return question;
	}

	public void setQuestion(String question) {
		this.question = question;
	}

	public void removeItem(ThesaurusItem item){
		this.items.remove(item);
	}
	
	public void getItem(int index){
		this.items.get(index);
	}
	
	public List<ThesaurusItem> getItems(){
		return this.items;
	}
	
	public void printThree() {
		if(getAnswer()  != null)
			System.out.print("A: " + this.getAnswer().toUpperCase() + " --> ");
		System.out.println("Q: " + this.getQuestion());
		System.out.println(this.getDescription());
		for(ThesaurusItem item : this.items){
			item.printThree();
		}
	}
}
